package com.stork.cms.activity;

import java.util.Calendar;

import com.stork.cms.R;
import com.stork.cms.R.id;
import com.stork.cms.R.layout;
import com.stork.cms.R.menu;

import android.os.Bundle;
import android.provider.CalendarContract;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.CalendarView;
import android.widget.Toast;
import android.widget.CalendarView.OnDateChangeListener;

public class Calendaractivity extends Activity {

	CalendarView cmsCalendar;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_calendar);
		
		cmsCalendar=(CalendarView)findViewById(R.id.calendarView1);
		
		
		cmsCalendar.setOnDateChangeListener(new OnDateChangeListener() {
			
			@Override
			public void onSelectedDayChange(CalendarView view, int year, int month,
					int dayOfMonth) {
				// TODO Auto-generated method stub
				
				Toast.makeText(getApplicationContext(), dayOfMonth+"/"+month+"/"+year, Toast.LENGTH_SHORT).show();
				
			}			
					
		});
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.calendar, menu);
		return true;
	}

}
